package cn.shadowsouls.system.bean;

import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 授权列表
 *
 * @author shadowsouls
 * @version 1.0
 */

@Component
public class AuthorizationSet {
    private static Set<String> authorSet = new HashSet<>();

    public static boolean isEmpty() {
        return authorSet.isEmpty();
    }

    public static boolean addAuthor(String authorCode) {
        return authorSet.add(authorCode);
    }

    public static boolean removeAuthor(String authorCode){
        return authorSet.remove(authorCode);
    }

    public static boolean existAuthor(String authorCode) {return authorSet.contains(authorCode);}

    public static boolean noExistAuthor(String authorCode){
        return !authorSet.contains(authorCode);
    }
}
